package demo.mappers;

import org.springframework.jdbc.core.RowMapper;

import demo.entity.Student;

import java.sql.ResultSet;
import java.sql.SQLException;

public class StudentRowMapper implements RowMapper<Student> {

    @Override
    public Student mapRow(ResultSet rs,int i) throws SQLException {
        Student student = new Student();
        student.setId(rs.getInt("id"));
        student.setName(rs.getString("name"));
        student.setStudentNumber(rs.getString("student_number"));
        return student;
    }
}
